This entry contains replication code for "It Matter What and Where We Measure: Education and Ideology in a Swedish Twin Design"

The code was executed using Stata version 15.1 and R 4.2.2. The Stata code requires the package reghdfe (version 5.7.3). The R code requires the packages "dplyr", "rio", "logr" and "BayesFactor".

The raw data is proprietary and used under license and cannot be shared by the authors but can be obtained from Statistics Sweden and the Swedish Twin Register following the requisite ethics approval and application procedure. To do this, the first step is to obtain permisson from a Swedish Ethical Review Board. The second step is to order the data from Statistics Sweden and the Swedish Twin Register. This also requires that at least one collaborator is based at a Swedish university. A complete description of the order procedure can be found on the following to pages: https://www.scb.se/en/services/guidance-for-researchers-and-universities/ and https://ki.se/en/research/swedish-twin-registry-for-researchers.


Variables of interest used in the main code are:
LopNrParID	twin pair identifier
TwinNr		identifies twin nr 1/2 within a pair (arbitrary)
zyg		zygosity, with 1 being MZ and 2 being DZ
eduYears	is education years
PGI_EA_single	polygenic index of education

The following variables are survey items on political ideology that are used to construct the outcomes:
decrease_public_sector decrease_welfare lower_taxes sell_public_enterprise more_private_healthcare more_free_trade more_freeschools more_freedom_companies decrease_finmarket_impact keep_property_taxes keep_maxtaxa decrease_economic_inequality earlier_grades ban_pornography limit_abortion harder_punishment language_test_citizenship fewer_refugees more_skilled_immigration more_support_immigrant_culture decrease_defense_spending less_carbondioxide decrease_pollution